package animal;

public class Simulator {  //模拟器类
public void playSound(Animal animal) { //方法，参数是Animal类型的animal
    System.out.println("动物种类: " + animal.getAnimalName());//调用Animal中getAnimalName方法输出
    System.out.println("叫声: " + animal.cry());  //调用Animal中cry方法输出
}
}